<html>
<head>
  <meta charset="UTF-8">
  <title>Document</title>

</head>
</head>
<body>
<div id="app">
  <p><h3>今天发钱了,发了{{Money}}</h3></p>
  <p><h3>纳税{{MoneyInTax}}</h3></p>
  <p><h3>上交给老婆{{MoneyChinaRMB}}</h3></p>
  <button v-on:click="btnMoney(12000)">发工资</button>
  <button v-on:click="btnMoney(10000)">发奖金</button>
</div>
<!-- 1:引包 -->
<script type="text/javascript" src="../../node_modules/vue/dist/vue.js"></script>
<script type="text/javascript">
  new Vue({
    el: "#app",
    data: function () {
      return {
        Money: 0,
        MoneyInTax: 0,
        MoneyChinaRMB: 0
      }
    },
    watch:{
      Money:function (num,num1) {
        this.MoneyInTax=Math.round(num*0.08)
        this.MoneyChinaRMB=Math.round(num*0.8)
      }
    },
    methods:{
      btnMoney:function (money) {
        this.Money=money
      }
    }

  })
</script>

</body>
</html>
